Skip to main content

Accessing the production environment

Production URL: https://api.delbank.com.br

When you're ready to access the production environment, you can use the following as an example on what you need for the production API. The production API requires that the mTLS certificate, the private key and the API key are set up correctly. You can use the example and change up as needed, depending on the type of HTTP request methods and the endpoint you're trying to reach

KeyDescription
mTLS certificateThe mTLS certificate our team sent (.pem file)
Private KeyThe private key that was generated along with the csr
API keyThe API key our team sent
const fs = require('fs');
const https = require('https');
const path = require('path');

const certPath = path.resolve(__dirname, 'mtls/my_cretificate.crt');
const keyPath = path.resolve(__dirname, 'mtls/my_private_key.key');
let httpsAgent = null;
if (fs.existsSync(certPath) && fs.existsSync(keyPath)) {
httpsAgent = new https.Agent({
cert: fs.readFileSync(certPath), //Here you put your certificate (.pem)
key: fs.readFileSync(keyPath), //Here you put your private key (.key)
});
}

headers = {
'x-delbank-api-key': process.env.API_KEY,
};

const apiResponse = await axios({
method: // 'GET', 'POST', 'PUT', 'DELETE'
url: //api.delbank.com.br/...,
headers: headers,
httpsAgent: httpsAgent,
});

Accessing the production environment via Postman

In Postman it's possible to add and manage certificates to enable authentication when sending requests. To do this, first, go to Settings.

Then inside, go to Certificates and click Add Certificate.

Now add the host URL, so that every request from this URL will use these certificates. In the CRT file put in the mTLS (.pem file) and in KEY file put in the private key that was generated along the CSR.

And finally, in x-delbank-api-key, put your API Key in the header.

That's it, you can now access the production API!